<template>
	<view class="market">
		<goodsList :hotGoods='goodsList'></goodsList>
	</view>
</template>

<script>
	import goodsList from '../../components/goodsList/goodsList.vue'
	import Bmob from '../../bmob/Bmob-2.2.4.min.js'
	//初始化
	Bmob.initialize("5f81d295c337fcde", "202020");
	export default {
		data() {
			return {
				goodsList: []
			}
		},

		methods: {
			getGoodsFromBmob(tableName) {
				const query = Bmob.Query(tableName)
				query.find().then(res => {
					for (var item of res) {
						// console.log(item)
						this.goodsList.push(item);
					}
				})
			}

		},
		components: {
			goodsList
		},
		onLoad() {
			this.getGoodsFromBmob('goodsList');
		}

	}
</script>

<style lang="scss">
	.market{
		background: #eee;
	}

</style>
